{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<!--block-->
	<div class="tm-label-md tm-bg-white tm-df-size">
		<div class="main-tab">
			<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-item1">
				<a class="mui-control-item tm-icon-btn mui-active href" href="#item1">
					<div class="tm-label-item">
						<div class="tm-label">
							全部
						</div>
						<div class="mui-icon mui-icon-arrowdown">

						</div>
					</div>
				</a>
				<a class="mui-control-item tm-icon-btn href" href="#item2">
					<div class="tm-label-item">
						<div class="tm-label">
							分类
						</div>
						<div class="mui-icon mui-icon-arrowdown">

						</div>
					</div>
				</a>
				{eq name="uinfo.roleid" value="8"}
				<a class="mui-control-item tm-icon-btn href" href="#item4">
					<div class="tm-label-item">
						<div class="tm-label">
							成员
						</div>
						<div class="mui-icon mui-icon-arrowdown">

						</div>
					</div>
				</a>
				{/eq}
				<a class="mui-control-item tm-icon-btn href" href="#item5">
					<div class="tm-label-item">
						<div class="tm-label">
							排序
						</div>
						<div class="mui-icon mui-icon-arrowdown">

						</div>
					</div>
				</a>
			</div>
		</div>
	</div>
	<!--block end-->
	<!--tab-con-->
	<div class="main-tab-con" id="main-tab-con" style="display: none;">
		<div id="item1" class="mui-control-content mui-active">
			<div class="uk-margin-small-top">
				<ul class="mui-table-view max">
					<li class="mui-table-view-cell">
						<a class="bbsfi-item" href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ datatype:'all'}" ajax-callback="suc_search">
							<span class="tm-df-size">全部</span>
						</a>
					</li>
					<li class="mui-table-view-cell">
						<a class="bbsfi-item" href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ datatype:'news'}" ajax-callback="suc_search">
							<span class="tm-df-size">今日新增</span>
						</a>
					</li>
					<li class="mui-table-view-cell">
						<a class="bbsfi-item" href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ datatype:'suc'}" ajax-callback="suc_search">
							<span class="tm-df-size">今日成交</span>
						</a>
					</li>
				</ul>
			</div>
		</div>
		<div id="item2" class="mui-control-content">
			<div class="tm-label-lg tm-bg-white uk-margin-small-top">
				<a href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{}" ajax-callback="suc_search">
					<div class="uk-text-center">
						<div class="tm-inline-1-3">
							不限
						</div>
					</div>
				</a>
			</div>
			<form method="post" action="{:url('index', ['token'=>$token, 'timestamp'=>time()])}">
			<div class="uk-margin-small-top">
				<div class="main-tab-inline">
					<div class="tm-flex">
						<div class="tab-left-nav">
							<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-item3">
								<!-- <a class="mui-control-item href" href="#item100">
									<div class="tm-label-lg">
										<span class="tm-df-size tm-font-bold">所在城市</span>
									</div>
								</a> -->
								<a class="mui-control-item mui-active href" href="#item200">
									<div class="tm-label-lg">
										<span class="tm-df-size tm-font-bold">客户状态</span>
									</div>
								</a>
								<a class="mui-control-item href" href="#item400">
									<div class="tm-label-lg">
										<span class="tm-df-size tm-font-bold">客户级别</span>
									</div>
								</a>
								{notin name="uinfo.roleid" value="8,10,11"}
								<a class="mui-control-item href" href="#item500">
									<div class="tm-label-lg">
										<span class="tm-df-size tm-font-bold">线索分类</span>
									</div>
								</a>
								{/notin}
							</div>
						</div>
						<div class="tm-flex-1">
							<form class="main-tab-con" id="formid">
								<div id="item200" class="mui-control-content mui-active">
									<div class="">
										<ul class="mui-table-view max mui-table-view-small">
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" checked name="typeid" id="checkbox" value="0" />
													<label for="checkbox">全部</label>
												</div>
											</li>
											{volist name=":config('CLIENT_TYPE')" id="v" key="k"}
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" name="typeid" id="checkbox{$k}" value="{$key}" />
													<label for="checkbox{$k}">{$v}</label>
												</div>
											</li>
											{/volist}
										</ul>
									</div>
								</div>
								<div id="item400" class="mui-control-content">
									<div class="">
										<ul class="mui-table-view max mui-table-view-small">
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" checked name="skilled" id="check" value="0" />
													<label for="checkbox">全部</label>
												</div>
											</li>
											{volist name=":config('CLIENT_SKILLED')" id="v" key="k"}
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" name="skilled" id="check{$k}" value="{$key}"/>
													<label for="check{$k}">{$v}</label>
												</div>
											</li>
											{/volist}
										</ul>
									</div>
								</div>
								<div id="item500" class="mui-control-content">
									<div class="">
										<ul class="mui-table-view max mui-table-view-small">
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" checked name="kind" id="kind" value="0" />
													<label for="checkbox">全部</label>
												</div>
											</li>
											{volist name=":config('CLIENT_KIND')" id="v" key="k"}
											<li class="mui-table-view-cell">
												<div class="mui-radio mui-left">
													<input type="radio" name="kind" id="kind{$k}" value="{$key}"/>
													<label for="check{$k}">{$v}</label>
												</div>
											</li>
											{/volist}
										</ul>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="uk-margin-large-top">
				<div class="main-content">
					<div class="to-btn-group">
						<ul class="uk-grid">
							<li class="uk-width-1-2">
								<button type="button" class="mui-btn mui-btn-gray mui-btn-block" onclick="close($('#main-tab-con').hide())">取消</button>
							</li>
							<li class="uk-width-1-2">
								<button type="button" class="mui-btn mui-btn-green mui-btn-block" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="func" datafun="get_data"  ajax-callback="suc_search">确定</button>
							</li>
						</ul>
					</div>
				</div>
			</div>
			</form>
		</div>
		<div id="item4" class="mui-control-content">
			<div class="tm-label-lg tm-bg-white uk-margin-small-top">
				<!-- <a href="{:setAppUrls('/index/client/index')}"> -->
				<a href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{}" ajax-callback="suc_search">
					<div class="uk-text-center">
						<div class="tm-inline-1-3">
							不限
						</div>
					</div>
				</a>
			</div>
			<div class="data-card-search uk-margin-small-top">
				<!--search-->
				<!-- <div class="search-block">
					<div class="mui-input-row mui-search">
						<input type="search" class="mui-input-clear" value="" placeholder="搜索">
					</div>
				</div> -->
				<!--search end-->
				<div class="search-cell-card">
					<ul class="mui-table-view max">
						{volist name=":get_model_func('AdminUser', 'list_datad', ['puserid'=>$_userid])" id="v"}
						<li class="mui-table-view-cell">
							<a href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ brokerid:{$v.userid} }" ajax-callback="suc_search">
								<div class="tm-flex flex-align-center">
									<div class="tm-atav tm-flex-head">
										<div class="tm-location-parent">
											<div class="tm-location-img" style="background-image: url({$v.avatar});"></div>
											<img class="redundant-img" src="{$images_path}px-1.png" alt="" width="100">
										</div>
									</div>
									<div class="tm-label-no">
										<span class="tm-df-size tm-font-boldx">{$v.realname}</span>
									</div>
								</div>
							</a>
						</li>
						{/volist}
					</ul>
				</div>
			</div>
		</div>
		<div id="item5" class="mui-control-content">
			<div class="uk-margin-small-top">
				<div class="main-tab-inline">
					<div class="tm-flex">
						<div class="tab-left-nav tab-left-nav-auto">
							<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-item3">
								<a class="mui-control-item href mui-active" href="#item-3-100">
									<div class="tm-label-lg">
										<span class="tm-df-size tm-font-bold">录入时间</span>
									</div>
								</a>
							</div>
						</div>
						<div class="tm-flex-1">
							<div class="main-tab-con">
								<div id="item-3-100" class="mui-control-content mui-active">
									<div class="tm-df-size">
										<ul class="mui-table-view max mui-table-view-small">
											<li class="mui-table-view-cell">
												<a class="mui-navigate-right" href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ addtime:'asc'}" ajax-callback="suc_search">
													<div class="tm-cell-pad">
														<div class="uk-padding-small-left">
															<span class="tm-font-bold">正序排列</span>
														</div>
													</div>
												</a>
											</li>
											<li class="mui-table-view-cell">
												<a class="mui-navigate-right" href="javascript:;" coco_template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{ addtime:'desc'}" ajax-callback="suc_search">
													<div class="tm-cell-pad">
														<div class="uk-padding-small-left">
															<span class="tm-font-bold">倒序排列</span>
														</div>
													</div>
												</a>
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
										</ul>
									</div>
								</div>
								<div id="item-3-400" class="mui-control-content">
									<div class="tm-df-size">
										<ul class="mui-table-view max mui-table-view-small">
											<li class="mui-table-view-cell">
												<a class="mui-navigate-right" href="{:setAppUrls('/index/client/index/orders/asc')}">
													<div class="tm-cell-pad">
														<div class="uk-padding-small-left">
															<span class="tm-font-bold">由高到低</span>
														</div>
													</div>
												</a>
											</li>
											<li class="mui-table-view-cell">
												<a class="mui-navigate-right" href="{:setAppUrls('/index/client/index/orders/desc')}">
													<div class="tm-cell-pad">
														<div class="uk-padding-small-left">
															<span class="tm-font-bold">由低到高</span>
														</div>
													</div>
												</a>
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
											<li class="mui-table-view-cell">
												&nbsp;
												<!--占位-->
											</li>
										</ul>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--tab-con end-->
	<!--点击筛选消失-->
	<div class="tm-border-top" id="hide-this">
		<div class="client-cell" id="clue-list" template coco-tag="clue" coco-url="/v2/client/client_list" coco-data="{}"></div>
		<script type="text/html" id="clue-tpl">
			{{# layui.each(d.response,function(index,item){ }}
				<div class="client-card uk-margin-small-top">
					<div class="mui-table-view no">
						<div class="mui-table-view-cell">
							<a href="personal.html?clientid={{ item.id }}" open_h5_url class="mui-navigate-right">
								<div class="tm-cell-pad">
									<div class="tm-flex flex-align-center">
										<div class="tm-flex-head">
											<div class="tm-icon">
												<img src="{$images_path}client-icon.png" alt="" width="12" height="12" />
											</div>
										</div>
										<div class="tm-flex-1">
											<span class="tm-df-size tm-font-bold">{{ item.name }}</span>
										</div>
										<div class="tm-flex-1">
											<span class="tm-df-size tm-font-bold">{{ item.kindname }}</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<div class="tm-label-no uk-padding-xsmall-bottom">
							<div class="main-content">
								<div class="tm-font-gray tm-df-size">
									<div class="tm-flex">
										<span class="tm-6em">所属经纪人：</span>{{ item.realname }}
										<span class="tm-12em" style="margin-left: 30%;">{{ item.addtime }}</span>
									</div>
								</div>
							</div>
						</div>
					</div>
					{eq name="uinfo.roleid" value="8"}
					<div class="tm-bg-white">
						<div class="tm-label-md">
							<div class="tm-flex flex-pack-center">
								<div class="tm-flex-1">
									<div class="tm-flex flex-pack-center">
										<a href="tel:{{ item.phone }}" class="tm-icon-item tm-icon-btn">
											<div class="tm-icon">
												<img src="{$images_path}phone.png" width="12" height="12" />
											</div>
											<div class="tm-icon-label">
												打电话
											</div>
										</a>
									</div>
								</div>
								<div class="tm-flex-1">
									<div class="tm-flex flex-pack-center">
										<a href="sms:{{ item.phone }}" class="tm-icon-item tm-icon-btn">
											<div class="tm-icon">
												<img src="{$images_path}weixin-gray.png" width="12" height="12" />
											</div>
											<div class="tm-icon-label">
												发短信
											</div>
										</a>
									</div>
								</div>
								<div class="tm-flex-1">
									<div class="tm-flex flex-pack-center">
										<a href="order_add.html?clientid={{ item.id }}&token={$token}&timestamp=time()" class="tm-icon-item tm-icon-btn" href>
											<div class="tm-icon">
												<img src="{$images_path}order-icon.png" width="12" height="12" />
											</div>
											<div class="tm-icon-label">
												录订单
											</div>
										</a>
									</div>
								</div>
							</div>
						</div>
					</div>
					{/eq}
				</div>
			{{# }) }}
		</script>
	</div>
	<!--点击筛选消失 end-->
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function get_data(obj) {
		var datajson = {};
		datajson.typeid = $("input[name='typeid']:checked").val();
		datajson.skilled = $("input[name='skilled']:checked").val();
		datajson.kind = $("input[name='kind']:checked").val();
		return datajson;
	}
	function suc_search(obj,data) {
		$("#main-tab-con").hide();
		$("#hide-this").show();
	}
	function goto_page(clientid) {
		window.location.href = WapSiteHost + '/index/client/order_add.html?clientid=' + clientid + '&token=' + token + '&timestamp=' + timestamp;
	}
</script>
{/block}